import request from '@/utils/request'

// 获取房源
export const LookFor = function (params) {
  return request.get('/houses', { params })
}

// 获取城市列表
export const GetCityList = function (params) {
  return request.get('/area/city', { params })
}

// 查看收藏列表
export const getArticlesCollect = function (params) {
  return request.get('/user/favorites', { params })
}

// 房屋详情页
export const getArticleDetail = function (id) {
  return request.get('/houses/' + id)
}

// 房屋是否收藏
export const updateCollectNot = function (id) {
  return request.get('/user/favorites/' + id)
}
// 添加收藏
export const updateCollect = function (id) {
  return request.post('/user/favorites/' + id)
}

// 删除收藏
export const updateCollectDelete = function (id) {
  return request.delete('/user/favorites/' + id)
}
// 发布房源
export const releaseListings = function (data) {
  return request.post('/user/houses', data)
}
